/**
 * Created by uptain on 2017/8/27.
 */
const ja=new  Vue({
    el: '#main',
    data: {
       can_page:{
           type1:1,
           type2:1
       },
        pre_page:{
            type1:1,
            type2:0
        },
        can_min:{
            reason:"",
            value:0
        },
        min:{
            reason:"",
            value:0
        },

        can_data6:6,
        can_data5:0,
        can_data4:0,
        can_data3:0,
        can_data2:0,
        can_data1:0,
        cancel_price:{
            cash_all:288,
            cost:100,
            breach:88,
            refound:100
        }
    },

    methods: {
        show_page2(){
            this.pre_page.type1=0
            this.pre_page.type2=1

            $(".circle_true").each(function(){
               console.log($(this).parent().find("span").eq(0).text())
            })
            var temp = new FormData();
            temp.append("orderId", "");
            temp.append("reason","")
            $.ajax({
                url: "http://appv2.fxj178.com/home/order/cancel",
                type: 'post',
                data: temp,
                datatype: 'JSON',
                processData: false,
                contentType: false

            }).then(function (result) {
                var re = {};re = JSON.parse(result);
                if (re.err == 0) {

                }
            });
             var data = new FormData();
            data.append("orderId", "");

            $.ajax({
                url: "http://appv2.fxj178.com/home/order/getCancleOrderDetail",
                type: 'post',
                data: data,
                datatype: 'JSON',
                processData: false,
                contentType: false

            }).then(function (result) {
                var re = {};re = JSON.parse(result);
                if (re.err == 0) {

                }
            });


        },
        show_page1(){
            this.pre_page.type1=1
            this.pre_page.type2=0
        },
        diulei(){

            var temp = new FormData();
            temp.append("houseId","27716403916");

            $.ajax({
                url: "http://appv2.fxj178.com/home/houseDetail/getHouseDetail?token="+localStorage.token,
                type: 'post',
                data: temp,
                datatype: 'JSON',
                processData: false,
                contentType: false

            }).then(function (result) {
                var re = {};re = JSON.parse(result);
                if (re.err == 0) {

                }
            });
        },

    },


})

$(document).ready(function(){
    $(".infraCell").click(function(){
       var index= $(this).find(".span_right").attr("data")
        var name="can_data"+index
        var isActive = $(this).find(".span_right").hasClass("circle_true");

        if (isActive) {
            $(this).find(".span_right").removeClass("circle_true");
            $(this).find(".span_right").addClass("circle_false");

        }else{
            $(this).find(".span_right").removeClass("circle_false");
            $(this).find(".span_right").addClass("circle_true");

        }
    })
})